package scyMachineClass

import (
	"github.com/gin-gonic/gin"
	"likeadmin/clog"
	"likeadmin/dbc"
	"likeadmin/model"
	"likeadmin/sqlop"
	"likeadmin/webu"
	"time"
)

func CreateScyMachineClass(c *gin.Context) {
	scyMachineClass := &model.ScyMachineClass{}
	c.ShouldBind(scyMachineClass)
	scyMachineClass.CreateTime = time.Now().Unix()
	clog.Info("scyMachineClass,CreateScyMachineClass,scyMachineClass=", scyMachineClass)
	err := dbc.DB.Create(scyMachineClass).Error
	webu.GinResult("CreateScyMachineClass Error:", c, err)
}

func UpdateScyMachineClass(c *gin.Context) {
	/*	scyMachineClass := &model.ScyMachineClass{}
		c.ShouldBind(scyMachineClass)
		clog.Info("scyMachineClass,UpdateScyMachineClass,scyMachineClass=", scyMachineClass)
		err := sqlop.ExecFourP("update scy_machineClass set scy_machineClass_name=?,scy_machineClass_introduction=?,update_time=? where id=?", scyMachineClass.ScyMachineClassName, scyMachineClass.ScyMachineClassIntroduction, time.Now().Unix(), scyMachineClass.Id)
		webu.GinResult("UpdateScyMachineClass Error:", c, err)*/

}

func DeleteScyMachineClass(c *gin.Context) {
	scyMachineClass := &model.ScyMachineClass{}
	c.ShouldBind(scyMachineClass)
	clog.Info("scyMachineClass,DeleteScyMachineClass,scyMachineClass=", scyMachineClass)
	err := sqlop.ExecTwoP("update scy_machine_class set is_deleted=1,delete_time=? where id=?", time.Now().Unix(), scyMachineClass.Id)
	webu.GinResult("DeleteScyMachineClass Error:", c, err)
}
